package com.atguigu.gulimall.ware.config;

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@Configuration
@EnableTransactionManagement   //开启事物
@MapperScan("com.atguigu.gulimall.ware.dao")
public class MybatisConfig {
    // 最新版
    @Bean
    public PaginationInterceptor paginationInterceptor() {
        PaginationInterceptor interceptor = new PaginationInterceptor();
//        interceptor.setOverflow(true);
//        interceptor.setLimit(1000);
        return interceptor;
    }

}
